#include <stdio.h>
#include <unistd.h>
#include "ledmatrix.h"
char string_char[][6] = {
{0x02, 0x02, 0xFE, 0x02, 0x02, 0x00}, //T
{0xFE, 0x12, 0x32, 0x52, 0x8C, 0x00}, //R
{0x7E, 0x80, 0x80, 0x80, 0x7E, 0x00}, //U
{0x7C, 0x82, 0x82, 0x82, 0x7C, 0x00}, //O
{0xFE, 0x04, 0x08, 0x10, 0xFE, 0x00}, //N
{0x7C, 0x82, 0x92, 0x92, 0x74, 0x00}  //G
};
int main(int argc, char * argv[])
{
    int ix0 = 1;
    int ix1 = MATRIX_WEIGHT-1;
    int iy = 1;
    int i = 7, j = 0, len = 0, k = 0;
    matrix_init();
    //matrix_set_pixel(23,7);
    //matrix_set_pixel(23,23);
    //matrix_set_ix(0,16);
    //matrix_set_iy(5);
    //matrix_set_pixel(23,6);
    #if 0
    matrix_set_pixel(0,0);
    matrix_set_pixel(0,1);
    matrix_set_pixel(0,2);
    matrix_set_pixel(0,3);
    matrix_set_pixel(0,4);
    matrix_set_pixel(0,5);
    matrix_set_pixel(0,6);
    matrix_set_pixel(0,7);
    #endif
    #if 0
    i = 0;
    for(j = 0; j < 6; j ++)
    {
        k = 6;
        len += k;
        for(; i < len; i++)
        {
            matrix_set_data(i,0,string_char[j][i - len + k]);
        }
    }
    i = 0;
    len = 0;
    for(j = 0; j < 6; j ++)
    {
        k = 6;
        len += k;
        for(; i < len; i++)
        {
            matrix_set_data(i,8,string_char[j][i - len + k]);
        }
    }
    #endif
    //matrix_putchar(0,0,'T');
    matrix_putstring(0,0,"ABCDEFGHIJKLMNOPQRSTUVWXYZ ");
    //matrix_putstring(0,0,"IIIIIIII    ");
    matrix_putstring(0,8,"0123456789:?! ");
    while(1)
    {
        //matrix_display();
        //matrix_set_ix(0,ix0);
        //matrix_set_ix(1,ix1);
        //matrix_set_iy(iy);
        matrix_loop();
        usleep(100*1000);
    }
    return 0;
}

